package com.bjx.flow.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bjx.api.flow.domain.vo.FlowNodeVO;
import com.bjx.api.flow.domain.vo.FlowStartVO;
import com.bjx.flow.domain.query.FlowInstanceQuery;
import com.bjx.flow.domain.query.FlowNodeQuery;
import com.bjx.flow.domain.vo.FlowInstanceVO;
import org.camunda.bpm.engine.runtime.ProcessInstance;

import java.util.List;

/**
 * @desc: 基础流程运行接口
 * @author: liushuai
 * @date: 2022/11/1 16:19
 */
public interface IBaseFlowService {
    /**
     * 流程实例对象
     * @param flowStartVO
     * @return: org.camunda.bpm.engine.runtime.ProcessInstance
     * @Author: liushuai
     * @Date: 2022/11/1 16:29
     */
    ProcessInstance startFlow(FlowStartVO flowStartVO);

    /**
     * 获取第一个审批节点信息
     * @param definitionId
     * @return: com.bjx.flow.domain.vo.FlowNodeVO
     * @Author: liushuai
     * @Date: 2022/11/17 21:12
     */
    FlowNodeVO selectFirstFlowNodeInfoByDefinitionId(String definitionId);

    /**
     * 根据当前用户id分页获取待办信息
     * @param
     * @return: com.bjx.common.core.domain.R
     * @Author: liushuai
     * @Date: 2022/12/24 18:35
     */
    IPage<FlowInstanceVO> listTodoTaskByCurrentUser(FlowInstanceQuery flowInstanceQuery);

    /**
     * 获取下一个任务节点
     * @param flowNodeQuery
     * @Author: liushuai
     * @Date: 2023/1/4 15:19
     */
    List<FlowNodeVO> getNextTaskNode(FlowNodeQuery flowNodeQuery);

    /**
     * 根据流程定义Key获取第一个流程节点信息
     * @param definitionKey
     * @return: com.bjx.api.flow.domain.vo.FlowNodeVO
     * @Author: liushuai
     * @Date: 2023/1/10 11:04
     */
    FlowNodeVO selectFirstFlowNodeInfoByDefinitionKey(String definitionKey);
}
